package com.kyrie.system.cryptography;

import java.util.Base64;

/***
 * 描述: base64方式加解密
 *
 * @author wuxiang
 * @date 2020-04-28 16:46
 */
public class Base64Cryptography implements Cryptography{

    @Override
    public String encrypt(String srcCrypt) {
        return Base64.getEncoder().encodeToString(srcCrypt.getBytes());
    }

    @Override
    public String decrypt(String enCrypt) {
        return new String(Base64.getDecoder().decode(enCrypt.getBytes()));
    }
}
